package com.leaf.u_spring.chapter05;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

/**
 * 配置DispatcherServlet
 */
public class SpittrWebAppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {

	/**
	 * 根配置定义
	 */
	@Override
	protected Class<?>[] getRootConfigClasses() {
		return new Class<?>[]{RootConfig.class };
	}

	/**
	 * 指定配置类
	 */
	@Override
	protected Class<?>[] getServletConfigClasses() {
		return new Class<?>[]{WebConfig.class};
	}


	/**
	 * 将DispatcherServlet映射到 "/"
	 */
	@Override
	protected String[] getServletMappings() {
		return new String[]{ "/" };
	}

}
